import React, { memo } from 'react';
import ListCalendar from '@/components/CustomCalendar/ListCalendar';
import WeekCalendar from '@/components/CustomCalendar/WeekCalendar';
import moment from 'moment';

moment.locale('zh-cn');

const calendarOptions = {
  weekNumberCalculation: 'local',
  defaultView: 'listWeek',
  listDayAltFormat: false, // listWeek 右边不显示
  header: {
    left: '',
    center: '',
    right: '',
  },
  titleFormat: { year: 'numeric', month: 'long', day: 'numeric' }, // 顶部title样式
  defaultRangeSeparator: ' - ',
  minTime: '08:00:00', // timeline 开始时间
  maxTime: '21:30:00', // timeline 结束时间
  eventTimeFormat: {
    hour: '2-digit',
    minute: '2-digit',
  },
  height: 'auto',
  columnHeaderText: date => moment(date).format('dddd'),
};
const SubjectResult = memo(({ resultList }) => (
  <>
    <WeekCalendar events={resultList} />
    <ListCalendar events={resultList} options={calendarOptions} />
  </>
));

export default SubjectResult;
